<?php

namespace app\common\validate;

use think\Validate;

//文章模型验证器
class Article extends Validate
{
    protected $rule = [
        'title' => 'require|max:15|unique:article',
    ];

    protected $message = [
        'title.require' => '文章必须填写',
        'title.max' => '文章不能大于15个字',
        'title.unique' => '文章已经存在，请重新填写',

    ];

    protected $scene = [
        'add' => ['title'],
        'edit' => ['title']
    ];
}
